1. /* sifdivkn.cpp by K.Tsuru */
  2. // function ID = 425, 426 BRADIX
  3. /**********************************************
  4. SInteger class
  5. It provides the quotient m/n and remainder m%n.
  6. The Knuth's method division is used
  7. ***********************************************/
  8. #ifndef SN_H
  9. #include "sn.h"
  10. #endif
  11. // function ID = 425
  12. //If the remainder is not necessary set rem = 0.
  13. void IIDiv(const SInteger& m, const SInteger& n, Ldiv_t& r, int rem){
  14. KnuthIIDiv(m, n, r, rem);
  15. }
  16. // function ID = 426
  17. void KnuthIIDiv(const SInteger& m, const SInteger& n, Ldiv_t& r, int rem){
  18. int dm = SLong::LLDivMode(); //It keeps the value of "llDivMode".
  19. SLong::UseKnuthLLDiv(); //It indicates to use "KnuthLLDiv()".
  20. /*
  21. It does not directly call the "KnuthLLdiv()", bacause the pre- and post-processing
  22. are included in the "LLDiv()".
  23. */
  24. r = LLDiv(m, n, rem);
  25. //It restores llDivMode. When "NewtonLLDiv()" is not used, it is not linked.
  26. SInteger tmp;
  27. tmp.SetLLDivMode(dm);
  28. // r.quot.LLDivMode(dm);
  29. }

sifdivkn.cpp : last modifiled at 2010/05/16 13:43:18(1,013 bytes)
created at 2016/04/25 14:53:17
The creation time of this html file is 2017/10/25 11:09:45 (Wed Oct 25 11:09:45 2017).